package com.yu;

import com.yu.service.UserService;
import com.yu.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserTest {
    public static void main(String[] args) {
        //以前的nwe对象
      /*  UserService userService = new UserServiceImpl();
        userService.save();*/

        //通过配置文件得到spring容器
        ApplicationContext cxt = new ClassPathXmlApplicationContext("applicationContext.xml");
       UserService userService = (UserService) cxt.getBean("userService");
       userService.save();
        //System.out.println(cxt.getBean("userService"));
    }

}
